package io;

import javax.xml.stream.events.StartDocument;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
  文件复制
 */
public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fi = new FileInputStream("fa85cd37_E864745_083fe912.png");
        FileOutputStream ou = new FileOutputStream("fa85cd37_E864745_083fe12.png");
        int d;
        long start = System.currentTimeMillis();
        while ((d = fi.read())!= -1){
            ou.write(d);
        }
        long end = System.currentTimeMillis();
        System.out.println(end-start);//复制耗时多少毫秒
        System.out.println("复制完毕");
        fi.close();
        ou.close();
    }

}
